<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
	<title>API: autocomplete  YAHOO.widget.DS_XHR   (YUI Library)</title>
	<link rel="stylesheet" type="text/css" href="assets/api.css">
    <script type="text/javascript" src="assets/api-js"></script>
    <script type="text/javascript" src="assets/ac-js"></script>
</head>

<body id="yahoo-com">

<div id="doc3" class="yui-t2">

	<div id="hd">
        <a href="http://developer.yahoo.com/yui/"><h1>Yahoo! UI Library</h1></a>
        <h3>AutoComplete Widget&nbsp; <span class="subtitle">2.5.1</span></h3>
        <p>
        <a href="./index.html">Yahoo! UI Library</a> 
            &gt; <a href="./module_autocomplete.html">autocomplete</a>
                 &gt; YAHOO.widget.DS_XHR 
                
            </p>

	</div>

	<div id="bd">
		<div id="yui-main">
			<div class="yui-b">
            <form name="yui-classopts-form">
    <span id="classopts"><input type="checkbox" name="showprivate" id="showprivate" /> Show Private</span>
    <span id="classopts"><input type="checkbox" name="showprotected" id="showprotected" /> Show Protected</span>
            </form>

                    <h2>
                        

                        
                        
                            Class <b>YAHOO.widget.DS_XHR</b>
                        <span class="extends">
                           - extends <a href="YAHOO.widget.DataSource.html">YAHOO.widget.DataSource</a>
                        </span>

                        <span class="extends">
                        </span>
                        
                        </code>
                    </h2>
                    <!-- class tree goes here -->
                    
                
  

                    <div class="summary description">
                        Implementation of YAHOO.widget.DataSource using XML HTTP requests that return
query results.
                    </div>

                        <div class="section constructor details">
                        <h3 id="constructor">Constructor</h3>
                        <div class="content">
                            <div class="detail">
                                <strong>YAHOO.widget.DS_XHR</strong>
                                <code>
                                    (
  
                                        
                                                
                                                sScriptURI

                                                , 
                                                aSchema

                                                , 
                                                oConfigs
                                    )
                                </code>
                                <div class="description">
                                        <dl>
                                            <dt>Parameters:</dt>
                                                <dd>
                                                    <code>sScriptURI
                                                    &lt;String&gt; 
                                                    </code>
                                                      Absolute or relative URI to script that returns query
results as JSON, XML, or delimited flat-file data.
                                                </dd>
                                                <dd>
                                                    <code>aSchema
                                                    &lt;String[]&gt; 
                                                    </code>
                                                      Data schema definition of results.
                                                </dd>
                                                <dd>
                                                    <code>oConfigs
                                                    &lt;Object&gt; 
                                                    </code>
                                                      (optional) Object literal of config params.
                                                </dd>
                                        </dl>
                                    
                                    
                                </div>
                            </div>
                        </div>
                    </div>

                        <div class="section field details">
                            <h3 id="properties">Properties</h3>
                            <div class="content">
                                    <div class="private">
                                    <h4><a name="property__oConn">_oConn</a>
                                        <code>- private Object</code>
                                    </h4>
                                    <div class="detail">
                                        <div class="description">
                                            XHR connection object.
                                        </div>
                                    </div>
     
                                        


                                    <hr />
                                    </div>
                                    <div class="">
                                    <h4><a name="property_connMgr">connMgr</a>
                                        <code>- Object</code>
                                    </h4>
                                    <div class="detail">
                                        <div class="description">
                                            Alias to YUI Connection Manager, to allow implementers to customize the utility.
                                        </div>
                                    </div>
     
                                        
                                    <div class="default">
                                        Default Value: YAHOO.util.Connect
                                    </div>        


                                    <hr />
                                    </div>
                                    <div class="">
                                    <h4><a name="property_connTimeout">connTimeout</a>
                                        <code>- Number</code>
                                    </h4>
                                    <div class="detail">
                                        <div class="description">
                                            Number of milliseconds the XHR connection will wait for a server response. A
a value of zero indicates the XHR connection will wait forever. Any value
greater than zero will use the Connection utility's Auto-Abort feature.
                                        </div>
                                    </div>
     
                                        
                                    <div class="default">
                                        Default Value: 0
                                    </div>        


                                    <hr />
                                    </div>
                                    <div class="">
                                    <h4><a name="property_ERROR_DATAXHR">ERROR_DATAXHR</a>
                                        <code>- static final String</code>
                                    </h4>
                                    <div class="detail">
                                        <div class="description">
                                            Error message for XHR failure.
                                        </div>
                                    </div>
     
                                        


                                    <hr />
                                    </div>
                                    <div class="">
                                    <h4><a name="property_responseStripAfter">responseStripAfter</a>
                                        <code>- String</code>
                                    </h4>
                                    <div class="detail">
                                        <div class="description">
                                            String after which to strip results. If the results from the XHR are sent
back as HTML, the gzip HTML comment appears at the end of the data and should
be ignored.
                                        </div>
                                    </div>
     
                                        
                                    <div class="default">
                                        Default Value: "\n&#60;!-"
                                    </div>        


                                    <hr />
                                    </div>
                                    <div class="">
                                    <h4><a name="property_responseType">responseType</a>
                                        <code>- String</code>
                                    </h4>
                                    <div class="detail">
                                        <div class="description">
                                            XHR response data type. Other types that may be defined are YAHOO.widget.DS_XHR.TYPE_XML
and YAHOO.widget.DS_XHR.TYPE_FLAT.
                                        </div>
                                    </div>
     
                                        
                                    <div class="default">
                                        Default Value: YAHOO.widget.DS_XHR.TYPE_JSON
                                    </div>        


                                    <hr />
                                    </div>
                                    <div class="">
                                    <h4><a name="property_scriptQueryAppend">scriptQueryAppend</a>
                                        <code>- String</code>
                                    </h4>
                                    <div class="detail">
                                        <div class="description">
                                            String of key/value pairs to append to requests made to scriptURI. Define
this string when you want to send additional query parameters to your script.
When defined, queries will be sent to
&#60;scriptURI&#62;?&#60;scriptQueryParam&#62;=userinput&#38;&#60;scriptQueryAppend&#62;
                                        </div>
                                    </div>
     
                                        
                                    <div class="default">
                                        Default Value: ""
                                    </div>        


                                    <hr />
                                    </div>
                                    <div class="">
                                    <h4><a name="property_scriptQueryParam">scriptQueryParam</a>
                                        <code>- String</code>
                                    </h4>
                                    <div class="detail">
                                        <div class="description">
                                            Query string parameter name sent to scriptURI. For instance, queries will be
sent to &#60;scriptURI&#62;?&#60;scriptQueryParam&#62;=userinput
                                        </div>
                                    </div>
     
                                        
                                    <div class="default">
                                        Default Value: "query"
                                    </div>        


                                    <hr />
                                    </div>
                                    <div class="">
                                    <h4><a name="property_scriptURI">scriptURI</a>
                                        <code>- String</code>
                                    </h4>
                                    <div class="detail">
                                        <div class="description">
                                            Absolute or relative URI to script that returns query results. For instance,
queries will be sent to &#60;scriptURI&#62;?&#60;scriptQueryParam&#62;=userinput
                                        </div>
                                    </div>
     
                                        


                                    <hr />
                                    </div>
                                    <div class="">
                                    <h4><a name="property_TYPE_FLAT">TYPE_FLAT</a>
                                        <code>- static final Number</code>
                                    </h4>
                                    <div class="detail">
                                        <div class="description">
                                            Flat-file data type.
                                        </div>
                                    </div>
     
                                        


                                    <hr />
                                    </div>
                                    <div class="">
                                    <h4><a name="property_TYPE_JSON">TYPE_JSON</a>
                                        <code>- static final Number</code>
                                    </h4>
                                    <div class="detail">
                                        <div class="description">
                                            JSON data type.
                                        </div>
                                    </div>
     
                                        


                                    <hr />
                                    </div>
                                    <div class="">
                                    <h4><a name="property_TYPE_XML">TYPE_XML</a>
                                        <code>- static final Number</code>
                                    </h4>
                                    <div class="detail">
                                        <div class="description">
                                            XML data type.
                                        </div>
                                    </div>
     
                                        


                                    <hr />
                                    </div>


                            </div>
                        </div>

                        <div class="section field inheritance">
                            <h4>Properties inherited from <a href="YAHOO.widget.DataSource.html">YAHOO.widget.DataSource</a>:</h4>
                            <div class="content">
                                <code>
                                    
                                        <a class="private" href="YAHOO.widget.DataSource.html#property__aCache">_aCache</a><span class="private">,</span>
                                        <a class="private" href="YAHOO.widget.DataSource.html#property__sName">_sName</a><span class="private">,</span>
                                        <a class="" href="YAHOO.widget.DataSource.html#property_maxCacheEntries">maxCacheEntries</a><span class="">,</span>
                                        <a class="" href="YAHOO.widget.DataSource.html#property_queryMatchCase">queryMatchCase</a><span class="">,</span>
                                        <a class="" href="YAHOO.widget.DataSource.html#property_queryMatchContains">queryMatchContains</a><span class="">,</span>
                                        <a class="" href="YAHOO.widget.DataSource.html#property_queryMatchSubset">queryMatchSubset</a>
                                </code>
                            </div>
                        </div>

                        <div class="section method details">
                            <h3 id="methods">Methods</h3>
                            <div class="content">
                                    <div class="">
                                    <h4>
                                        <a name="method_doQuery">doQuery</a></h4>
                                    <div class="detail">
                                        <code>
                                        
                                        
                                        
                                        void
                                            <strong>doQuery</strong>
                                           (
                                                
                                                        
                                                         oCallbackFn
                                                    
                                                
                                                        , 
                                                         sQuery
                                                    
                                                
                                                        , 
                                                         oParent
                                                    
                                                
                                            )
                                        </code>
                                        
                                        <div class="description">
                                            Queries the live data source defined by scriptURI for results. Results are
passed back to a callback function.
                                        </div>

                                        <div class="description">

                                                <dl>
                                                    <dt>Parameters:</dt>
                                                        <dd>
                                                            <code>oCallbackFn &lt;HTMLFunction&gt;</code>
                                                              Callback function defined by oParent object to which to return results.
                                                        </dd>
                                                        <dd>
                                                            <code>sQuery &lt;String&gt;</code>
                                                              Query string.
                                                        </dd>
                                                        <dd>
                                                            <code>oParent &lt;Object&gt;</code>
                                                              The object instance that has requested data.
                                                        </dd>
                                                </dl>

                                                <dl>
                                                    <dt>Returns:
                                                    <code>
                                                        void
                                                    </code></dt>
                                                    <dd></dd>
                                                </dl>
             
                                        </div>

                                    </div>
                                    <hr />
                                    </div>
                                    <div class="">
                                    <h4>
                                        <a name="method_parseResponse">parseResponse</a></h4>
                                    <div class="detail">
                                        <code>
                                        
                                        
                                        
                                        void
                                            <strong>parseResponse</strong>
                                           (
                                                
                                                        
                                                         sQuery
                                                    
                                                
                                                        , 
                                                         oResponse
                                                    
                                                
                                                        , 
                                                         oParent
                                                    
                                                
                                            )
                                        </code>
                                        
                                        <div class="description">
                                            Parses raw response data into an array of result objects. The result data key
is always stashed in the [0] element of each result object.
                                        </div>

                                        <div class="description">

                                                <dl>
                                                    <dt>Parameters:</dt>
                                                        <dd>
                                                            <code>sQuery &lt;String&gt;</code>
                                                              Query string.
                                                        </dd>
                                                        <dd>
                                                            <code>oResponse &lt;Object&gt;</code>
                                                              The raw response data to parse.
                                                        </dd>
                                                        <dd>
                                                            <code>oParent &lt;Object&gt;</code>
                                                              The object instance that has requested data.
                                                        </dd>
                                                </dl>

                                                <dl>
                                                    <dt>Returns:
                                                    <code>
                                                        void
                                                    </code></dt>
                                                    <dd></dd>
                                                </dl>
             
                                        </div>

                                    </div>
                                    <hr />
                                    </div>
                            </div>
                        </div>

                            <div class="section field inheritance">
                                <h4>Methods inherited from <a href="YAHOO.widget.DataSource.html">YAHOO.widget.DataSource</a>:</h4>
                                <div class="content">
                                    <code>
                                            <a class="private" href="YAHOO.widget.DataSource.html#method__addCacheElem">_addCacheElem</a><span class="private">,</span>                                            <a class="private" href="YAHOO.widget.DataSource.html#method__doQueryCache">_doQueryCache</a><span class="private">,</span>                                            <a class="private" href="YAHOO.widget.DataSource.html#method__init">_init</a><span class="private">,</span>                                            <a class="" href="YAHOO.widget.DataSource.html#method_doQuery">doQuery</a><span class="">,</span>                                            <a class="" href="YAHOO.widget.DataSource.html#method_flushCache">flushCache</a><span class="">,</span>                                            <a class="" href="YAHOO.widget.DataSource.html#method_getResults">getResults</a><span class="">,</span>                                            <a class="" href="YAHOO.widget.DataSource.html#method_toString">toString</a>
                                    </code>
                                </div>
                            </div>



                        <div class="section field inheritance">
                            <h4>Events inherited from <a href="YAHOO.widget.DataSource.html">YAHOO.widget.DataSource</a>:</h4>
                            <div class="content">
                                <code>
                                        <a class="" href="YAHOO.widget.DataSource.html#event_cacheFlushEvent">cacheFlushEvent</a><span class="">,</span>                                        <a class="" href="YAHOO.widget.DataSource.html#event_cacheQueryEvent">cacheQueryEvent</a><span class="">,</span>                                        <a class="" href="YAHOO.widget.DataSource.html#event_dataErrorEvent">dataErrorEvent</a><span class="">,</span>                                        <a class="" href="YAHOO.widget.DataSource.html#event_getCachedResultsEvent">getCachedResultsEvent</a>                                        <a class="" href="YAHOO.widget.DataSource.html#event_getResultsEvent">getResultsEvent</a>                                        <a class="" href="YAHOO.widget.DataSource.html#event_queryEvent">queryEvent</a>
                                </code>
                            </div>
                        </div>



			</div>
		</div>
		<div class="yui-b">
            <div class="nav">

                    <div class="module">
                        <h4>Modules</h4>
                        <ul class="content">

                                <li class=""><a href="module_animation.html">animation</a></li>

                                <li class="selected"><a href="module_autocomplete.html">autocomplete</a></li>

                                <li class=""><a href="module_button.html">button</a></li>

                                <li class=""><a href="module_calendar.html">calendar</a></li>

                                <li class=""><a href="module_charts.html">charts</a></li>

                                <li class=""><a href="module_colorpicker.html">colorpicker</a></li>

                                <li class=""><a href="module_connection.html">connection</a></li>

                                <li class=""><a href="module_container.html">container</a></li>

                                <li class=""><a href="module_cookie.html">cookie</a></li>

                                <li class=""><a href="module_datasource.html">datasource</a></li>

                                <li class=""><a href="module_datatable.html">datatable</a></li>

                                <li class=""><a href="module_dom.html">dom</a></li>

                                <li class=""><a href="module_dragdrop.html">dragdrop</a></li>

                                <li class=""><a href="module_editor.html">editor</a></li>

                                <li class=""><a href="module_element.html">element</a></li>

                                <li class=""><a href="module_event.html">event</a></li>

                                <li class=""><a href="module_get.html">get</a></li>

                                <li class=""><a href="module_history.html">history</a></li>

                                <li class=""><a href="module_imagecropper.html">imagecropper</a></li>

                                <li class=""><a href="module_imageloader.html">imageloader</a></li>

                                <li class=""><a href="module_json.html">json</a></li>

                                <li class=""><a href="module_layout.html">layout</a></li>

                                <li class=""><a href="module_logger.html">logger</a></li>

                                <li class=""><a href="module_menu.html">menu</a></li>

                                <li class=""><a href="module_profiler.html">profiler</a></li>

                                <li class=""><a href="module_profilerviewer.html">profilerviewer</a></li>

                                <li class=""><a href="module_resize.html">resize</a></li>

                                <li class=""><a href="module_selector.html">selector</a></li>

                                <li class=""><a href="module_slider.html">slider</a></li>

                                <li class=""><a href="module_tabview.html">tabview</a></li>

                                <li class=""><a href="module_treeview.html">treeview</a></li>

                                <li class=""><a href="module_uploader.html">uploader</a></li>

                                <li class=""><a href="module_yahoo.html">yahoo</a></li>

                                <li class=""><a href="module_yuiloader.html">yuiloader</a></li>

                                <li class=""><a href="module_yuitest.html">yuitest</a></li>
                        </ul>
                    </div>

                    <div class="module">
                        <h4>Classes</h4>
                        <ul class="content">
                                <li class=""><a href="YAHOO.widget.AutoComplete.html">YAHOO.widget.AutoComplete</a></li>
                                <li class=""><a href="YAHOO.widget.DataSource.html">YAHOO.widget.DataSource</a></li>
                                <li class=""><a href="YAHOO.widget.DS_JSArray.html">YAHOO.widget.DS_JSArray</a></li>
                                <li class=""><a href="YAHOO.widget.DS_JSFunction.html">YAHOO.widget.DS_JSFunction</a></li>
                                <li class=""><a href="YAHOO.widget.DS_ScriptNode.html">YAHOO.widget.DS_ScriptNode</a></li>
                                <li class="selected"><a href="YAHOO.widget.DS_XHR.html">YAHOO.widget.DS_XHR</a></li>
                        </ul>
                    </div>

                    <div class="module">
                        <h4>Files</h4>
                        <ul class="content">        
                                <li class=""><a href="AutoComplete.js.html">AutoComplete.js</a></li>
                                <li class=""><a href="DataSource.js.html">DataSource.js</a></li>
                        </ul>
                    </div>

                    <div class="module">
                        <h4>Properties</h4>
                        <ul class="content">        
                                <li class="private"><a href="#property__oConn">_oConn</a>
                                        <!--<code>&lt;Number&gt;</code>-->
                                </li>
                                <li class=""><a href="#property_connMgr">connMgr</a>
                                        <!--<code>&lt;Number&gt;</code>-->
                                </li>
                                <li class=""><a href="#property_connTimeout">connTimeout</a>
                                        <!--<code>&lt;Number&gt;</code>-->
                                </li>
                                <li class=""><a href="#property_ERROR_DATAXHR">ERROR_DATAXHR</a>
                                        <!--<code>&lt;Number&gt;</code>-->
                                </li>
                                <li class=""><a href="#property_responseStripAfter">responseStripAfter</a>
                                        <!--<code>&lt;Number&gt;</code>-->
                                </li>
                                <li class=""><a href="#property_responseType">responseType</a>
                                        <!--<code>&lt;Number&gt;</code>-->
                                </li>
                                <li class=""><a href="#property_scriptQueryAppend">scriptQueryAppend</a>
                                        <!--<code>&lt;Number&gt;</code>-->
                                </li>
                                <li class=""><a href="#property_scriptQueryParam">scriptQueryParam</a>
                                        <!--<code>&lt;Number&gt;</code>-->
                                </li>
                                <li class=""><a href="#property_scriptURI">scriptURI</a>
                                        <!--<code>&lt;Number&gt;</code>-->
                                </li>
                                <li class=""><a href="#property_TYPE_FLAT">TYPE_FLAT</a>
                                        <!--<code>&lt;Number&gt;</code>-->
                                </li>
                                <li class=""><a href="#property_TYPE_JSON">TYPE_JSON</a>
                                        <!--<code>&lt;Number&gt;</code>-->
                                </li>
                                <li class=""><a href="#property_TYPE_XML">TYPE_XML</a>
                                        <!--<code>&lt;Number&gt;</code>-->
                                </li>
                        </ul>
                    </div>

                    <div class="module">
                        <h4>Methods</h4>
                        <ul class="content">        
                                <li class=""><!--<code>void</code>-->
                                <a href="#method_doQuery">doQuery</a>
                                </li>
                                <li class=""><!--<code>void</code>-->
                                <a href="#method_parseResponse">parseResponse</a>
                                </li>
                        </ul>
                    </div>



            </div>
		</div>
	</div>
	<div id="ft">
        <hr />
        Copyright &copy; 2007 Yahoo! Inc. All rights reserved.
	</div>
</div>
</body>
</html>
